package advanceQuery

import (
	"fmt"
	"github.com/gofiber/fiber/v2"
	"go_cms/app/service"
	"go_cms/utils"
)

type AdvanceQueryController struct {
}


func (this *AdvanceQueryController)RoleMenu(ctx *fiber.Ctx) error {
	uid:=ctx.Params("uid")
	token,err:=utils.GetToken(ctx)
	if err!=nil{
		return utils.Failed(ctx,"token 验证失败")
	}
	if utils.Debug{
		fmt.Printf("advanceQuery.go 20 uid=%s,token=%#v\n",uid,token)
	}
	// 3.登陆 service 层实现
	us:=service.UserService{}
	menus := us.RoleMenu(uid)
	if menus !=nil{
		return utils.Success(ctx,menus)
	}

	return utils.Failed(ctx,"获取角色菜单error")
}